package com.summer.service;

import com.summer.dao.UserMapper;
import com.summer.web.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl implements UserService{

	@Autowired
	private UserMapper userMapper;
	
	public int insertUser(User user) {
		return userMapper.insert(user);
	}


	@Override
	public User getUserById(long userId) {
		return userMapper.selectByPrimaryKey(userId);
	}


	@Override
	public int deleteUserById(long userId) {
		return userMapper.deleteByPrimaryKey(userId);
	}

}
